package medium第一个最后一个;

import org.testng.annotations.Test;

import java.util.ArrayList;
import java.util.List;

public class Solution {
    public int[] searchRange(int[] nums, int target) {
        int[] a = new int[2];
        List<Integer> list = new ArrayList<>();
        for (int i:
                nums) {
            list.add(i);
        }
        a[0] = list.indexOf(target);
        a[1] = list.lastIndexOf(target);
        return a;
    }
    @Test
    public void test(){
        int[] nums={};

        for (int i:
                searchRange(nums,0)) {
            System.out.println(i);
        }
    }
}
